﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="oilreport.aspx.cs" Inherits="client_oilReport" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Oil Report</title>
    <link href="../styles/client.css" rel="stylesheet" type="text/css" />
    <link href="../styles/lytebox.css" rel="stylesheet" type="text/css" media="screen" />

    <script src="../javascripts/lytebox.js" type="text/javascript"></script>

</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager EnablePartialRendering="true" ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div id="content_area" style="min-height: 1100px">
        <h2>
            Oil Report
        </h2>
        <div id="status_wrapper">
            <div class="status">
                <h3>
                    Date of Survey:<asp:Label ID="Date_label" runat="server" Text="" ></asp:Label><asp:Label ID="Label1" runat="server" Text="UIN:"></asp:Label></h3>
                <div class="form_box1">
                    <asp:GridView ID="GridView1" runat="server" 
                        OnRowDataBound="TaskGridView_RowDataBound" Font-Size="14px" Width="706px" 
                        CellPadding="4" ForeColor="#333333" GridLines="None" Height="239px">
                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <EditRowStyle BackColor="#999999" />
                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    </asp:GridView>
                    <br />
                    <asp:TextBox ID="TextBox1" runat="server" Width="576px"></asp:TextBox>
                </div>
            </div>
            <div class="status">
                <asp:SqlDataSource ID="SqlDataSourceDateRecorded" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                    
                    SelectCommand="SELECT CONVERT(varchar(10),OilReports.tested_date,3) as tested_date1 FROM OilReports INNER JOIN Components ON OilReports.Component_id = Components.component_id INNER JOIN Machines ON Components.machine_id = Machines.machine_id WHERE (Components.machine_id = @id) GROUP BY OilReports.tested_date">
                    <SelectParameters>
                        <asp:QueryStringParameter Name="id" QueryStringField="id" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <table id="selecttable" runat="server" class="form_box2">
                    <tr>
                        <td class="label">
                            Select Client
                        </td>
                        <td>
                            <asp:DropDownList ID="DropDownClientList" AutoPostBack="true" runat="server" OnSelectedIndexChanged="Client_Changed"
                                DataTextField="clientName" DataValueField="clientid" 
                                CssClass="DropDownList">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td class="label">
                            Select Sites
                        </td>
                        <td>
                            <asp:DropDownList ID="SelectSite_DropDownList1" AutoPostBack="true" runat="server"
                                OnSelectedIndexChanged="Site_changed" DataTextField="SiteName" 
                                DataValueField="siteid" CssClass="DropDownList">
                                <asp:ListItem>Any</asp:ListItem>
                                <asp:ListItem>Choose Sites</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                            <asp:UpdatePanel ID="upnl" runat="server">
                                <ContentTemplate>
                                    <asp:CheckBoxList ID="SitesCheckBoxList" runat="server" CssClass="CheckBoxList">
                                    </asp:CheckBoxList>
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="SelectSite_DropDownList1" />
                                </Triggers>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                    <tr>
                        <td  class="label">
                            Select Severity
                        </td>
                        <td>
                            <asp:DropDownList ID="SelectSeverity_DropDownList" AutoPostBack="true" runat="server"
                                OnSelectedIndexChanged="Severity_changed" DataTextField="clientName" 
                                DataValueField="clientid" CssClass="DropDownList">
                                <asp:ListItem>Any</asp:ListItem>
                                <asp:ListItem>Choose Severity</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                            <asp:UpdatePanel ID="upnl0" runat="server">
                                <ContentTemplate>
                                    <asp:CheckBoxList ID="SeverityCheckBoxList" runat="server" 
                                        CssClass="CheckBoxList">
                                    </asp:CheckBoxList>
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="SelectSeverity_DropDownList" />
                                </Triggers>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="DateLabel" runat="server" Text="Select a date" CssClass="label"></asp:Label>
                        </td>
                        <td>
                            <asp:DropDownList ID="DropDownListDate" runat="server" DataSourceID="SqlDataSourceDateRecorded"
                                DataTextField="tested_date1" DataTextFormatString=" {0:d}" 
                                DataValueField="tested_date1" CssClass="DropDownList">
                                <asp:ListItem></asp:ListItem>
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="DropDownListDate"
                                ErrorMessage="One date should be chosen!" 
                                CssClass="RequiredFieldValidator"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <asp:Button ID="Full_Report_Button" runat="server" Text="Get Report" 
                                OnClick="FullReport" CssClass="buttons" />
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    </form>
</body>
</html>
